<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/6/9
 * Time: 12:39
 */

namespace App\Http\Controllers\Validator;
use Validator;


class TypeVail
{
    //添加分类
    public static function addType($params)
    {
        $validator = Validator::make($params, [
            't_name'          => 'required'
        ]);
        if ($validator->fails()) {
            return  false;
        }
        return true;
    }
    //删除分类
    public static function delType($params)
    {
        $validator = Validator::make($params, [
            't_id'          => 'required'
        ]);
        if ($validator->fails()) {
            return  false;
        }
        return true;
    }

    //  修改分类
    public static function editType($params)
    {
        $validator = Validator::make($params, [
            't_id'          => 'required',
            't_name'          => 'required'
        ]);
        if ($validator->fails()) {
            return  false;
        }
        return true;
    }
    //添加分类状态
    public static function addTypeDetail($params)
    {
        $validator = Validator::make($params, [
            'td_tid'           => 'required',
            'td_name'          => 'required'
        ]);
        if ($validator->fails()) {
            return  false;
        }
        return true;
    }
    //修改分类状态
    public static function editTypeDetail($params)
    {
        $validator = Validator::make($params, [
            'td_id'            => 'required',
            'td_tid'           => 'required',
            'td_name'          => 'required'
        ]);
        if ($validator->fails()) {
            return  false;
        }
        return true;
    }

    //删除分类状态
    public static function delTypeDetail($params)
    {
        $validator = Validator::make($params, [
            'td_id'            => 'required'
        ]);
        if ($validator->fails()) {
            return  false;
        }
        return true;
    }
}